"Buboes, phlegm, blood and guts! Boils, bogeys, rot and pus! Blisters, fevers, weeping sores! From your wounds the fester pours."
-- The Chant of Nurgle
The following analyses require jupyterthemes, numpy, pandas, and plotly. Install them with pip.
from jupyterthemes.stylefx import set_nb_theme
set_nb_theme('grade3')
import os
PREFIX = os.environ.get('PWD', '.')
# PREFIX = "../build/outputs"
import numpy
import pandas
import plotly.graph_objs as go
import plotly.figure_factory as ff
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
Reading input files for the simulation.
compounds = pandas.read_csv(os.path.join(PREFIX, "compounds.csv"))
num_compounds = compounds.shape[0]
print('[{}] compounds were loaded.'.format(num_compounds))
metabolism = pandas.read_csv(os.path.join(PREFIX, "metabolism.csv"))
print('[{}] reactions were loaded.'.format(metabolism.shape[0]))
Reading timecourse data first.
timecourse = pandas.read_csv(os.path.join(PREFIX, "timecourse.csv"))
timecourse = timecourse.rename(columns={timecourse.columns[0]: "Time"})
concentrations = pandas.DataFrame(timecourse.values[: , : num_compounds+2], timecourse.index, timecourse.columns[ : num_compounds+2])
indices = [0] + list(range(num_compounds+2, timecourse.shape[1]))
fluxes = pandas.DataFrame(timecourse.values[: , indices], timecourse.index, timecourse.columns[indices])
Plotting concentrations of compounds.
plot1(concentrations, "concentration_markers", nsteps=15, xlabel="Compound", ylabel="Concentration")
Plotting time series of compound concentrations.
plot2(concentrations, "concentration_lines", xlabel="Time", ylabel="Concentration")
plot1(fluxes, "flux_markers", nsteps=15, rescaled=True, xlabel="Reaction", ylabel="Relative Flux")
plot2(fluxes, "flux_lines", rescaled=True, xlabel="Time", ylabel="Relative Flux")